﻿@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
    ViewBag.Title = "考试库管理";
    List<Exam> list = ViewBag.list;
}

<div>
    <a href="@Url.Action("Manager")" class="layui-btn">返回管理</a>
</div>
<div>
    <a href="@Url.Action("ExamEdit")" class="layui-btn">添加考试</a>
</div>
<style>
    #tab1 th, #tab1 td {
        text-align: center;
    }

        #tab1 td.left {
            text-align: left;
        }

        #tab1 td.right {
            text-align: right;
        }
</style>
<table id="tab1" class="layui-table">
    <thead>
        <tr>
            <th width="10%">ID</th>
            <th>名称</th>
            <th width="10%">编辑</th>
            <th width="10%">设置题目</th>
            <th width="10%">删除</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var exam in list)
        {
        <tr>
            <td>@exam.ID</td>
            <td class="left">@exam.Name</td>
            <td><a href="@Url.Action("ExamEdit",new { ID = exam.ID})" class="layui-btn">编辑</a></td>
            <td><a href="@Url.Action("ExamQuest",new { ID = exam.ID})" class="layui-btn layui-btn-normal">设置题目</a></td>
            <td><button class="layui-btn layui-btn-danger">删除</button></td>
        </tr>
        }
    </tbody>
</table>